
#ifndef __MESH_ITEMSDEF_H__
#define __MESH_ITEMSDEF_H__

#include <CGAL/Cartesian.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/HalfedgeDS_vector.h>
#include <CGAL/HalfedgeDS_decorator.h>
#include <CGAL/IO/Polyhedron_iostream.h>

/// A vertex base with a normal vector
template <class Refs, class Traits>
struct My_Vertex : public CGAL::HalfedgeDS_vertex_base< Refs, CGAL::Tag_true, typename Traits::Point_3> {
   
   typedef typename Traits::Vector_3 Vector_3;
   typedef typename Traits::Point_3  Point_3;
   typedef typename CGAL::HalfedgeDS_vertex_base<Refs>::Vertex_handle      Vertex_handle;
   
   My_Vertex(const Point_3& p) : 
      CGAL::HalfedgeDS_vertex_base< Refs, CGAL::Tag_true, Point_3> (p) {
   }
   
   My_Vertex() : 
      CGAL::HalfedgeDS_vertex_base< Refs, CGAL::Tag_true, Point_3> () {
   }
   
   void normal(const Vector_3 &n)  { _normal = n; }
   Vector_3 normal()   const { return _normal; }
   Vector_3 &normal()  { return _normal; }
   
   void previous(const Vertex_handle &v)  { _previous=v; }
   Vertex_handle previous() const { return _previous; }
   
   Vector_3          _normal; /// Vertex normal
   Vertex_handle     _previous;        /// the previous vertex
   float             d;
};


/// An item type using My_Vertex
struct My_items : public CGAL::Polyhedron_items_3 {
   
   template < class Refs, class Traits>
   struct Vertex_wrapper {
      typedef My_Vertex <Refs, Traits>          Vertex;
   };
};

#endif
